package com.hcc.security.enetity;

import java.util.Collection;
import org.springframework.beans.BeanUtils;
import org.springframework.security.core.CredentialsContainer;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * @Author: HC
 * @Date: 2019/4/22 16:16
 * @Version 1.0
 */
public class UserDetail  {


  public UserDetail(UserDetail user){
    BeanUtils.copyProperties(user,this );
  }

  /**
   * 清除敏感信息
   */
  public void eraseCredentials() {

  }

  public Collection<? extends GrantedAuthority> getAuthorities() {
    return null;
  }

//  public String getPassword() {
//    return super.getPassword();
//  }
//
//  public String getUsername() {
//    return super.getUserName();
//  }

  /**
   * 是否过期
   * @return
   */
  public boolean isAccountNonExpired() {
    return true;
  }

  /**
   * 是否锁定
   * @return
   */
  public boolean isAccountNonLocked() {
    return true;
  }

  /**
   * 资格
   * @return
   */
  public boolean isCredentialsNonExpired() {
    return true;
  }

  public boolean isEnabled() {
    return true;
  }
}
